/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-11-15 09:42:19
 * @LastEditors: huangtianyang
 * @LastEditTime: 2023-11-23 10:18:29
 * @FilePath: \cxl-driving-training\src\apis\login\index.ts
 */
import axios from '../../axios/index'

/**
 * 登录接口
 * @param phone
 * @param password
 * @returns
 */
export const login = (account: string, password: string) => {
    return axios({
        method: 'post',
        url: '/api/user/admin/login',
        data: { password, account }
    })
}
//刷新token
export const refreshToken = () => {
    return axios({
        method: 'post',
        url: '/api/user/admin/refreshToken'
    })
}

//退出登录
export const logOut = () => {
    return axios({
        method: 'post',
        url: '/api/user/admin/logout'
    })
}
//获取当前用户信息
export const getCurrentUserInfo = (id?: string) => {
    return axios({
        method: 'get',
        url: '/api/user/admin/principal',
        params: { id }
    })
}
